Field of the Invention
The present invention relates to a numerical controller for controlling machine tools and industrial machines, and more particularly, to a numerical controller having a function of switching a position control gain during synchronous control.
Description of the Related Art
In a synchronous controller configured so that the position of a master axis is fetched by means of a sensor or the like and a slave axis is synchronized with the master axis position, an actual position (real position) of the master axis is obtained and a command synchronized with the real position is given to the slave axis. If the synchronization command is given to the slave axis based on the real position of the master axis, a delay of a servomotor for the slave axis inevitably occurs as a synchronization error. To cancel this synchronization error, a position (expected position) at a future time corresponding to a position control gain of the slave axis is expected, and a synchronization command for the expected position is given to the slave axis.
Japanese Patent Application Laid-Open No. 2011-67016 discloses a technique for a machine or the like to which an electronic cam is applied. According to this technique, a phase lead circuit called a lead-angle control is added to a servo controller for positioning, whereby a delay of a control system is compensated to reduce a positional deviation, which is the difference between a position command value and a position detection value. Further, Japanese Patent Application Laid-Open No. 60-5306 discloses a technique in which a gain is switched during control.
If the position of the slave axis is falsely expected on account of a change of the speed of the master axis, the difference between the expected position and a synchronous position of the slave axis undesirably increases. Consequently, a correct synchronous position of the slave axis cannot be calculated, so that a synchronization error inevitably occurs. Thus, if the master axis speed changes, the slave axis cannot correctly synchronize with the motion of the master axis. In general, the longer an expectation time, the larger the difference between the expected position and the synchronous position tends to be. The lower the position control gain, the longer the expectation time is, the larger the difference between the expected position and the synchronous position is, and the higher the synchronization error is.
For example, a packing machine is configured so that goods are packed, by a holding device driven by a slave axis, into a box that is conveyed by a conveyor driven by a master axis. In the packing machine of this type, the position of the conveyor is obtained by a sensor or the like, and synchronous control is performed such that an axis for packing is driven in accordance with the position of the box on the conveyor. The packing machine cannot perform accurate packing unless the position of the axis (slave axis) for packing is correctly synchronized with an actual position (real position) of the axis (master axis) for driving the conveyor.
In order to synchronize the real position of the slave axis with that of the master axis without an error, in this packing machine, the synchronization command for the slave axis is compensated in consideration of a servo delay. The servo delay is compensated by, for example, expecting the position at the future time corresponding to the position control gain of the slave axis and commanding the expected position as the synchronous position.
If the speed of the synchronized master axis changes, the expected position is deviated from an actual synchronous position, and the deviation causes a synchronization error that results in a reduction in synchronization performance. As described above, this expectation time is determined depending on the position control gain, that is, the lower the position control gain, the longer the expectation time is. In general, the longer the expectation time, the more easily the difference between the expected position and the synchronous position occurs. In other words, the lower the gain, the longer the expectation time is, and the higher the synchronization error is.
Now let us suppose that the position control gain of the slave axis is constant during synchronization. If the position control gain is high when the master axis vibrates in a certain section during the synchronization, there is a problem that the synchronization performance is greatly affected by the vibration to cause a synchronization error in the vibration section, although it is satisfactory outside the vibration section. If the position control gain is low, in contrast, there is a problem that a synchronization error is caused by a speed change of the master axis, although the influence of the vibration is small.